start intent without onCreate {}

Posted by melvintcs on Stack Overflow See other posts from Stack Overflow or by melvintcs
Published on 2012-06-27T09:10:18Z Indexed on 2012/06/27 9:15 UTC
Read the original article Hit count: 134

Filed under:
|
|

i create a class extend Gallery and there is no onCreate, and i having a problem to run my intent. this is my sample code:

 this.setOnItemClickListener(new AdapterView.OnItemClickListener() {

 @Override
 public void onItemClick(AdapterView<?> parent, View v, int position, long id) {
 Intent intent = new Intent(v.getContext(), ClassName.class);
 startActivity(intent);
}}

i also tried below code to run, failed me also:

Intent intent = new Intent(ThisClassName.this, ClassName.class);
startActivity(intent);

Please advice me what should i do :)

© Stack Overflow or respective owner

Related posts about android

Related posts about android-intent